feat(team_participant): reorganize former members with subheaders in Former tab#7230
feat(team_participant): reorganize former members with subheaders in Former tab#7230
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts TeamParticipants wiki parsing to avoid overwriting an explicitly provided participant type (e.g., former) when the participant also has a staff role, fixing incorrect tab placement in the roster UI.
Changes:
- Update staff auto-assignment logic to trigger only when
typeis the default'player', preserving explicittypevalues.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
This has major implications on storage.
https://github.com/Liquipedia/Lua-Modules/blob/main/lua/wikis/commons/TeamParticipants/Repository.lua
will use the type set here to determine the individualprizemoney, and furthermore
https://github.com/Liquipedia/Lua-Modules/blob/main/lua/wikis/commons/Opponent.lua#L566
uses the type to determine whether to store someone as player or staff.
When former staff does not get the correct type here, it will count as player in the mentioned locations and store bad data.
This also affects LPDB/API consumers downstream.
|
In addition, in my personal opinion, all tabs that are not So i'd rather fix the display on the staff tab for former staff, but not move them to another tab. |
|
Ah right, major overlook from my part
Oh, didn't realize 'former' was reserved for players only. In that case yes, this approach doesn't work. Drafting the PR and thinking of alternative solutions. Also will think if we should keep the former staff in staff tab but have a distinction there with label / strikethrough or something. |
744d5ee to
295b4b9
Compare
Discussed with product, decided it would be best to show both Players and Staff under 'Former' but have subheaders above them so there's no confusion. |
|
The implementation currently in this PR seems non-functional, it is still depending on the type being |
|
Tbh, ideally we would differentiate between
|
This comment was marked as outdated.
This comment was marked as outdated.
true, had old changes in the dev env as you pointed out. back to the drawing board |
| if tabTypeEnum == TAB_ENUM.STAFF then | ||
| return personType == 'staff' | ||
| elseif tabTypeEnum == TAB_ENUM.FORMER then | ||
| return player.extradata.isFormer | ||
| else | ||
| return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum | ||
| end |
There was a problem hiding this comment.
| if tabTypeEnum == TAB_ENUM.STAFF then | |
| return personType == 'staff' | |
| elseif tabTypeEnum == TAB_ENUM.FORMER then | |
| return player.extradata.isFormer | |
| else | |
| return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum | |
| end | |
| if player.extradata.isFormer then | |
| return tabTypeEnum == TAB_ENUM.former | |
| else | |
| return PERSON_TYPE_TO_TAB[personType] == tabTypeEnum | |
| end |
To avoid former staff from appearing in both former and staff while reducing "duplicate" code
| local formerPlayers = Array.filter(players, function(player) | ||
| return player.extradata.isFormer and player.extradata.type ~= 'staff' | ||
| end) | ||
| local formerStaff = Array.filter(players, function(player) | ||
| return player.extradata.isFormer and player.extradata.type == 'staff' | ||
| end) |
There was a problem hiding this comment.
Need to avoid doing this for all tabs, and only do it for the former tab
|
In general: I still don't think its a great idea to have type and status as one. |
Yeah.. I'll discuss this with Rath later. Not happy with it either. Seems like with this non-former staff members don't render so putting it to draft again. Thanks for the patience, seems like we need a bigger rework.. |
Summary
Resolves #7101. Reorganizes how former staff and former players are displayed by moving them all to the "Former" tab with clear subheaders:
This provides better organization and clarity compared to displaying former staff in the Staff tab with strikethrough styling.
Key Changes
How did you test this change?
dev (tsf2) + devtools